# import threading
# import time
# '''同步对象Event 保证所有的线程中状态完全一致'''
# class Boss(threading.Thread):
#     def run(self):
#         print("Boss: 今晚所有人都要加班到10点钟")
#         print("状态是否被设定",event.isSet())
#         event.set()
#         time.sleep(5)
#         print("Boss:好现在所有人都可以下班了")
#         event.set()
# class Worker(threading.Thread):
#     def run(self):
#         event.wait() # 一旦event.set() 则event.wait()==pass
#         print("Worker:命苦啊 又要加班啊！！！！！")
#         time.sleep(2)
#         event.clear()
#         event.wait()
#         print("Worker :ohyear!!")
# if __name__ == "__main__":
#     event = threading.Event()
#     threads=[]
#     for i in range(6):
#         threads.append(Worker())
#     threads.append(Boss())
#     for t in threads:
#         t.start()
#     for t in threads:
#         t.join()
#     print("所有的都结束了")
import threading
import time
'''同步对象Event 保证所有的线程中状态完全一致'''
class teacher(threading.Thread):
    def run(self):
        print("teacher: 明天把之前的作业留的作业都完成交上来")
        print("状态是否被设定",event.isSet())
        event.set()
        time.sleep(5)
        print("teacher:既然这样那下周一交上来")
        event.set()
class student(threading.Thread):
    def run(self):
        event.wait() # 一旦event.set() 则event.wait()==pass
        print("student:啊那么多怎么可能一天完成啊！！！！！")
        time.sleep(2)
        event.clear()
        event.wait()
        print("student:ohyear!!")
if __name__ == "__main__":
    event = threading.Event()
    threads=[]
    for i in range(6):
        threads.append(student())
    threads.append(teacher())
    for t in threads:
        t.start()
    for t in threads:
        t.join()
    print("所有的都结束了")


